package com.code.base.info.service;

import java.util.List;
import java.util.Date;
import java.util.Map;
import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.code.base.info.persistence.InfoBldMapper;
import com.code.base.info.pojo.InfoBld;
import com.code.util.PrimaryKeyUtil;


@Service
public class InfoBldService {


	@Resource
	private InfoBldMapper infoBldMapper;

	public Long getInsertId() {
		return PrimaryKeyUtil.generatePrimaryKey();
	}

	public InfoBld getDataById(Long id) {
		return infoBldMapper.getDataById(id);
	}

	public List<InfoBld> getAllData() {
		return infoBldMapper.getAllData();
	}

	public int getDataCountByCondition(InfoBld entity) {
		return infoBldMapper.getDataCountByCondition(entity);
	}

	public List<InfoBld> getDataByCondition(InfoBld entity) {
		return infoBldMapper.getDataByCondition(entity);
	}

	public int getDataCountByLikeCondition(InfoBld entity) {
		return infoBldMapper.getDataCountByLikeCondition(entity);
	}

	public List<InfoBld> getDataByLikeCondition(InfoBld entity) {
		return infoBldMapper.getDataByLikeCondition(entity);
	}

	public List<InfoBld> getDataByIds(Long[] ids) {
		return infoBldMapper.getDataByIds(ids);
	}

	public void insertData(InfoBld entity) {
		insertData(entity, true);
	}

	public void insertData(InfoBld entity, boolean setIdValue) {
		if (setIdValue) {
			entity.setId(getInsertId());
		}
		infoBldMapper.insertData(entity);
	}

	public void updateData(InfoBld entity) {
		infoBldMapper.updateData(entity);
	}

	public void updateDataByParam(Map<String, Object> map) {
		if (map.size() == 0)
			return;

		infoBldMapper.updateDataByParam(map);
	}

	public void deleteDataByObject(InfoBld entity) {
		infoBldMapper.deleteDataByObject(entity);
	}

	public void deleteDataById(Long id) {
		infoBldMapper.deleteDataById(id);
	}

	public void deleteDataByIds(Long[] ids) {
		infoBldMapper.deleteDataByIds(ids);
	}

}
